
Partial Class master_pages_AdminMasterPage
    Inherits System.Web.UI.MasterPage
    Dim _EmployeeId As String
    Dim _bo As New Bo
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        _EmployeeId = Session("EmpId")
        If Not Page.IsPostBack Then
            If _EmployeeId Is Nothing Then
                imgbtn.ImageUrl = "~/images/login.jpg"
            Else
                imgbtn.ImageUrl = "~/images/logout.jpg"
            End If
        End If
    End Sub

    Protected Sub imgbtn_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgbtn.Click
        If _EmployeeId Is Nothing Then
            Response.Redirect("~/Client/frmLogin.aspx")
        Else
            _bo.UpdateLastLogin(_EmployeeId)
            Response.Redirect("~/Client/frmLogout.aspx")
        End If
    End Sub
End Class

